//
//  CALayer+Tool.h
//  JinXun
//
//  Created by Apple on 2022/1/15.
//

#import <QuartzCore/QuartzCore.h>
@import UIKit;


NS_ASSUME_NONNULL_BEGIN


typedef NS_ENUM(NSInteger,CALayerGradientColorType){
    /// 从上到下
    CALayerGradientColorType_TopToBottom,
    /// 从左到右
    CALayerGradientColorType_LeftToRight,
    /// 左上 到 右下
    CALayerGradientColorType_LeftTopToRightBottom,
    /// 左下 到 右上
    CALayerGradientColorType_LeftBottomToRightTop
};

@interface CALayer (Tool)


/// 渐变 layer
+ (CALayer *)gradualLayerWithColors:(NSArray <UIColor *> *)colors vierticalOrHorizontal:(BOOL)vertical frame:(CGRect)frame;

/// 渐变 layer
+ (CALayer *)gradualLayerWithColors:(NSArray <UIColor *> *)colors frame:(CGRect)frame type:(CALayerGradientColorType)type;

@end

NS_ASSUME_NONNULL_END
